gtk_init: Fix debug flags handling when a display is already open
authorChristoph Reiter <creiter@src.gnome.org>
Sun, 18 Feb 2018 09:34:52 +0000 (10:34 +0100)
committerChristoph Reiter <creiter@src.gnome.org>
Sun, 18 Feb 2018 09:34:52 +0000 (10:34 +0100)
commit8e540f2f620a68d03a6d40a0d7bc3f8b43f22f92
tree1343063be92050eb091abbb2b31cdd30ffb148e8
parent5aa939dc93a99736232b3a87511e8b78785c13a9
gtk_init: Fix debug flags handling when a display is already open

In PyGObject gdk_init() is called before gtk_init() and thus there is
already a default display open when gtk_init() is called.
The code assigning the display to the debug_flags struct gets only
called when the default display changes, which never happens
when there already is one. As a result GTK_DEBUG=interactive
doesn't do anyting with Python apps.

This makes it call the change callback in case a display is already
there.

See https://gitlab.gnome.org/GNOME/pygobject/issues/166
gtk/gtkmain.c